<script setup lang="ts">
function showMessage(message: string, type: 'info' | 'primary' | 'success' | 'warning' | 'error' = 'info') {
  ElMessage({
    message,
    type,
  })
}
</script>

<template>
  <div>
    <el-button-group>
      <el-button @click="$router.push('/demo')">
        示例
      </el-button>
      <el-button type="primary" @click="showMessage('主要按钮', 'primary')">
        主要按钮
      </el-button>
      <el-button type="success" @click="showMessage('成功按钮', 'success')">
        成功按钮
      </el-button>
      <el-button type="info" @click="showMessage('信息按钮', 'info')">
        信息按钮
      </el-button>
      <el-button type="warning" @click="showMessage('警告按钮', 'warning')">
        警告按钮
      </el-button>
      <el-button type="danger" @click="showMessage('危险按钮', 'error')">
        危险按钮
      </el-button>
    </el-button-group>
  </div>
</template>

<style scoped></style>
